include_defs("//ReactCommon/DEFS")

EXPORTED_HEADERS = [
    "InspectorInterfaces.h",
    "JavaScriptCore.h",
    "JSCHelpers.h",
    "JSCWrapper.h",
    "noncopyable.h",
    "Unicode.h",
    "Value.h",
]

rn_xplat_cxx_library(
    name = "jscinternalhelpers",
    srcs = glob(
        ["*.cpp"],
        excludes = ["systemJSCWrapper.cpp"],
    ),
    headers = glob(
        ["*.h"],
        excludes = EXPORTED_HEADERS,
    ),
    header_namespace = "",
    exported_headers = dict([
        (
            "jschelpers/%s" % header,
            header,
        )
        for header in EXPORTED_HEADERS
    ]),
    compiler_flags = [
        "-Wall",
        "-fexceptions",
        "-frtti",
        "-fvisibility=hidden",
        "-std=c++1y",
    ],
    exported_deps = [
        react_native_xplat_target("privatedata:privatedata"),
    ],
    fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,
    force_static = True,
    visibility = [
        "PUBLIC",
    ],
    deps = JSC_INTERNAL_DEPS + [
        "xplat//folly:molly",
    ],
)

rn_xplat_cxx_library(
    name = "jschelpers",
    srcs = [],
    compiler_flags = [
        "-Wall",
        "-fexceptions",
        "-fvisibility=hidden",
        "-std=c++1y",
    ],
    fbobjc_frameworks = [
        "$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
    ],
    fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,
    fbobjc_srcs = ["systemJSCWrapper.cpp"],
    force_static = True,
    visibility = [
        "PUBLIC",
    ],
    deps = [":jscinternalhelpers"],
)
